package com.airy.highSpeed.service.impl;

import com.airy.highSpeed.dao.oracle.CktxCpcDao;
import com.airy.highSpeed.entity.CktxCpcEntity;
import com.airy.highSpeed.service.CktxCpcService;
import com.airy.highSpeed.utils.PageUtils;
import com.airy.highSpeed.utils.Query;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;


@Service("cktxCpcService")
public class CktxCpcServiceImpl extends ServiceImpl<CktxCpcDao, CktxCpcEntity> implements CktxCpcService {

    @Autowired
    CktxCpcDao cktxCpcDao;

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<CktxCpcEntity> page = this.page(
                new Query<CktxCpcEntity>().getPage(params),
                new QueryWrapper<CktxCpcEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public List<CktxCpcEntity> findAll() {
        return cktxCpcDao.findAll();
    }

    @Override
    public int findCountByStationNameAndBeginDateAndEndDate(Map<String,String> map) {
        return cktxCpcDao.findCountByStationNameAndBeginDateAndEndDate(map);
    }

    @Override
    public String findENSTATIONIDByStationName(String stationName) {
        return cktxCpcDao.findENSTATIONIDByStationName(stationName);
    }

    @Override
    public List<CktxCpcEntity> findAllLastweek(Map<String, String> mm) {
        return cktxCpcDao.findAllLastweek(mm);
    }


}